package ru.evga.inse.server.gwt.admin.client.place;

import ru.evga.gwt.lib.common.client.place.PlaceImpl;
import ru.evga.gwt.lib.common.client.place.PlaceParamMap;
import ru.evga.inse.server.gwt.admin.client.menu.AdminMenuItem;

public class AdminMenuPlaceUtil
{
    public static final String KEY_MAIN_MENY = "MM";

    static public PlaceImpl.PlaceImplBuilder getBuilderForMenu(AdminMenuItem item)
    {
        PlaceImpl.PlaceImplBuilder b = new PlaceImpl.PlaceImplBuilder();
        b.add(KEY_MAIN_MENY, item.toString());
        return b;
    }
    
    static public AdminMenuItem getMenuItem(PlaceParamMap placeParamMap)
    {
        return AdminMenuItem.valueOf(placeParamMap.get(KEY_MAIN_MENY));
    }
}
